package practice06;

public class Teacher extends  Person{
    private Integer klass;

    public Integer getKlass(){
        return klass;
    }
    public Teacher(String name, Integer age) {
        super(name, age);
    }
    public Teacher(String name,Integer age,Integer klass){
        super(name,age);
        this.klass=klass;
    }
    @Override
    public String introduce(){
        if(getKlass()==null){
            return super.introduce()+" I am a Teacher. I teach No Class.";
        }
        return super.introduce()+" I am a Teacher. I teach Class "+getKlass()+".";
    }
}
